package com.androidcourse.changeandget.Database;

import android.database.sqlite.SQLiteDatabase;
import android.view.View;
import android.widget.Button;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;

import com.androidcourse.changeandget.R;
import com.androidcourse.changeandget.User.Good;

public class DB extends AppCompatActivity {
    DBHelper helper;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_db);

        helper=new DBHelper(  DB.this);
        Button btn=findViewById(R.id.create);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View V) {
                SQLiteDatabase db=helper.getWritableDatabase();
                Good init=new Good();
                init.setChange(false);
                init.setDGood("很好");
                init.setGname("笔");
                init.setEGood("橡皮");
                init.setGID("11");
                init.setSID("2052615");
                helper.insertStudentData ("2052615", "123", "三", "李嘉琪" ,"男", "123");
                helper.insertStudentData ("2052613", "123", "三", "翟彦成" ,"男", "123");
                helper.insertStudentData ("2052614", "123", "三", "陶司昂" ,"男", "123");
                helper.insertStudentData ("2052616", "123", "三", "范永辉" ,"男", "123");
            }
        });
    }
}